﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FluentValidation;
using Monk.Site.Models;
using Monk.Site.Assistant;

namespace Monk.Site.Areas.Backend.Models
{
    public class SignupModelValidator : AbstractValidator<SignupModel>
    {
        private Dictionary<string, FieldModel> dic = FormValidation.GetConfigureDicByRoute("Backend", "Entry", "Index");

        public SignupModelValidator()
        {
            RuleFor(u => u.AdminName)
                .NotEmpty().WithMessage(dic["v_AdminName"].Nullmsg)
                .Matches(dic["v_AdminName"].BackendRegExp).WithMessage(dic["v_AdminName"].Errormsg);
        }
    }
}